home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickTime™ VR 2.0 SDK / QTVR C⁄C++ Runtime API / Sample Code / QTVRSamplePlayer / src / init.c < prev    next >
Encoding:
Text File  |  1997-05-22  |  1.1 KB  |  88 lines  |  [TEXT/CWIE]

  1. // Initialization and Deinitialization code
  2.  
  3. // System headers
  4. #include <Fonts.h>
  5. #include <Movies.h>
  6. #include <Resources.h>
  7.  
  8. // API headers
  9.  
  10. // Application-specific headers
  11. #include "app.h"
  12. #include "AE.h"
  13. #include "qtvrsupp.h"
  14.  
  15.  
  16. /////
  17. //
  18. // Local Prototypes
  19. //
  20. /////
  21.  
  22. // Toolbox
  23. void InitToolBox();
  24.  
  25.  
  26. /////
  27. //
  28. // Run the program's initialization sequence
  29. //
  30. /////
  31.  
  32. void DoInit(void)
  33. {
  34.     // Initialize globals
  35.     g.Done = false;
  36.  
  37.     InitToolBox();    // Initialize the Toolbox
  38.  
  39.     AEInit();        // Initialize AppleEvents
  40.  
  41.     MenuBarInit();    // Initialize the Menu Bar
  42.  
  43.     mQTVRInit();    // Initialize QTVR Support
  44.  
  45. }
  46.  
  47. /////
  48. //
  49. // Run the program's shutdown sequence
  50. //
  51. /////
  52.  
  53. void DeInit(void)    // Run the program's shutdown sequence
  54. {
  55.     CloseAllMovies();
  56.     mQTVRUninit();    // Dump QTVR Support
  57. }
  58.  
  59.  
  60. /////
  61. //
  62. // Initialize the Toolbox
  63. //
  64. /////
  65.  
  66. void InitToolBox()
  67. {    
  68.     MaxApplZone();
  69.     InitGraf(&qd.thePort);
  70.     InitFonts();
  71.     FlushEvents(everyEvent, 0);
  72.     InitWindows();
  73.     InitMenus();
  74.     TEInit();
  75.     InitDialogs(0L);
  76.     InitCursor();
  77.     
  78.     if(EnterMovies())
  79.         {
  80.         UserMessage("\pCould not initialize QuickTime.");
  81.         g.Done = true;
  82.         return;
  83.         }    
  84.  
  85. }
  86.  
  87.  
  88.